#include "Panel.h"
#include <QVBoxLayout>
namespace Softwarer
{
	
	PanelDecorator::PanelDecorator(ITitlebar* titlebar, QWidget* widget)
		: QWidget(widget->parentWidget())
		, m_widget(widget)
		, m_titlebar(titlebar)
	{
		setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
		//this->setStyleSheet("background-color: rgb(255, 0, 0);");
		widget->setParent(this);
		titlebar->setParent(this);
		QVBoxLayout* m_layout = new QVBoxLayout;
		m_layout->addWidget(titlebar);
		widget->setFixedSize(widget->size());
		m_layout->addWidget(widget);
		m_layout->setSpacing(0);
		m_layout->setContentsMargins(0, 0, 0, 0);
		setLayout(m_layout);

	}

	void PanelDecorator::setTitle(const QString& title)
	{
		if (m_titlebar != nullptr) 
		{

		}
	}

	PanelDecorator::~PanelDecorator()
	{
	}
}